package com.neusmart.common.util;

import android.content.Context;
import android.telephony.TelephonyManager;
import android.text.TextUtils;

public class TelephoneUtil {

    /**
     * 获取机器唯一标识
     *
     * @param context
     * @return
     */
    public static String getLocalDeviceId(Context context) {
        TelephonyManager tm = (TelephonyManager) context
                .getSystemService(Context.TELEPHONY_SERVICE);
        String deviceId = tm.getDeviceId();
        if (TextUtils.isEmpty(deviceId))
            deviceId = String.valueOf(System.currentTimeMillis());
        L.d("deviceId", deviceId);
        return deviceId;
    }

}
